<extend name="Public/baseConf"/>
<block name="breadcrumb"> 
	<div class="row wrapper border-bottom white-bg page-heading">
	    <div class="col-lg-6">
	        <h2><present name="data">导航管理</h2>
	        <ol class="breadcrumb">
	            <li><a href="{:U('index/index')}">首页</a></li>
	            <li class="active">
	                <strong>导航管理 </strong>
	            </li>
	        </ol>
	    </div>
	    <div class="col-lg-6">
            <div class="title-action">
				<span class="block pull-right">
					<a class="btn btn-primary" href="{:U('add','pid='.$pid)}">
						<i class="fa fa-pencil align-top"></i>新增
					</a>
			        <a class="btn btn-danger ajax-post" href="javascript:;">
						<i class="fa fa-trash align-top"></i>删除
					</a>
					<button class="list_sort btn btn-warning btn-success" url="{:U('sort',array('pid'=>I('get.pid',0)),'')}" target-form="ids">
						<i class="fa fa-flag"></i>排序
					</button>
				</span>
            </div>
        </div>
	</div>
</block>
<block name="body">
	<div class="row">
            <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>配置管理列表</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="table-responsive">
                    <form class="ids">
		                  <table class="table table-striped table-bordered table-hover dataTables-example" >
			                  <thead>
			                  <tr>
									<th class="row-selected">
										<input class="checkbox check-all" type="checkbox">
									</th>
									<th>ID</th>
									<th>导航名称</th>
									<th>导航地址</th>
				                    <th>排序</th>
									<th>级别</th>
									<th>操作</th>
			                  </tr>
			                  </thead>
			                  <tbody>
									<notempty name="list">
									<volist name="list" id="channel">
										<tr>
											<td><input class="ids row-selected" type="checkbox" name="" id="" value="{$channel['id']}"> </td>
											<td>{$channel.id}</td>
											<td><a href="{:U('index?pid='.$channel['id'])}">{$channel.title}</a></td>
											<td>{$channel.url}</td>
					                        <td>{$channel.sort}</td>
					                        <td>{$channel.level}</td>
											<td>
												<a title="编辑" href="{:U('edit?id='.$channel['id'].'&pid='.$pid)}">编辑</a>
												<a href="{:U('setStatus?ids='.$channel['id'].'&status='.abs(1-$channel['status']))}" class="ajax-get">{$channel.status|show_status_op}</a>
												<a class="confirm ajax-get" title="删除" href="{:U('del?id='.$channel['id'])}">删除</a>
											</td>
										</tr>
									</volist>
									<else/>
									<td colspan="7" class="text-center"> aOh! 暂时还没有内容! </td>
									</notempty>
			                  </tbody>
		                  </table>
		            </form>
		            <div class="page pull-right">
				     	{$_page}
			 		</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
</block>

<block name="script">
<script type="text/javascript">
    $(function() {
    	//点击排序
    	$('.list_sort').click(function(){
    		var url = $(this).attr('url');
    		var ids = $('.ids:checked');
    		var param = '';
    		if(ids.length > 0){
    			var str = new Array();
    			ids.each(function(){
    				str.push($(this).val());
    			});
    			param = str.join(',');
    		}

    		if(url != undefined && url != ''){
    			window.location.href = url + '/ids/' + param;
    		}
    	});
    });
</script>
</block>